package com.hanbang.taitaigou.model;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.io.Serializable;

/**
 * Created by Administrator on 2016/3/23.
 */
@Table(name = "DbGwcData")
public class DbGwcData implements Serializable{
    //商品的id
    @Column(name = "id", isId = true, autoGen = false)
    private int id;

    /**
     * 原价
     */
    @Column(name = "originalPrice")
    private double originalPrice;
    /**
     * 零售价
     */
    @Column(name = "sellPrice")
    private double sellPrice;

    /**
     * 选择的数量
     */
    @Column(name = "selectNumber")
    private int selectNumber;

    /**
     * 名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 图片地址
     */
    @Column(name = "imgUrl")
    private String imgUrl;
    /**
     * 库存
     */
    @Column(name = "quantity")
    private int quantity;

    public DbGwcData() {
    }

    public DbGwcData(int id, double originalPrice, double sellPrice, int selectNumber, String name, String imgUrl, int quantity) {
        this.id = id;
        this.originalPrice = originalPrice;
        this.sellPrice = sellPrice;
        this.selectNumber = selectNumber;
        this.name = name;
        this.imgUrl = imgUrl;
        this.quantity = quantity;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(double originalPrice) {
        this.originalPrice = originalPrice;
    }

    public double getSellPrice() {
        return sellPrice;
    }

    public void setSellPrice(double sellPrice) {
        this.sellPrice = sellPrice;
    }

    public int getSelectNumber() {
        return selectNumber;
    }

    public void setSelectNumber(int selectNumber) {
        this.selectNumber = selectNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    /**
     * 判断库存
     *
     * @return true:可以加入
     */
    public boolean isAddKucun() {
        return selectNumber <= quantity;
    }
}
